package com.swf.seed.netty.test;

import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.handler.codec.http.DefaultHttpRequest;
import org.jboss.netty.handler.codec.http.HttpMethod;
import org.jboss.netty.handler.codec.http.HttpRequest;
import org.jboss.netty.handler.codec.http.HttpVersion;

public class ClientMain {  
    public static void main(String[] args) {  
        HttpClient httpClient=new HttpClient();  
        ChannelFuture connectFuture=httpClient.connect();  
        if (httpClient.checkFutureState(connectFuture)) {  
            System.out.println("connect ok");  
            HttpRequest request=new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "thunder.zip");  
//          HttpRequest request=new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "thunder.java");  
            ChannelFuture writeFuture= httpClient.write(request);  
            if (httpClient.checkFutureState(writeFuture)) {  
                System.out.println("write ok");  
            }  
        }  
    }  
}